﻿<%@ Page Language="C#" Theme="Samples" AutoEventWireup="true" CodeFile="WebForm3.aspx.cs" Inherits="Samples_Prompt_WebForm3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    
<script type="text/javascript">
    function meetsCondition(sender, args)
    {
        args.set_cancel($get('dropDown1').value == 2);
    }
</script>
    
    
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="sm1" runat="server" />
    <div>
        <h2>Using prompt trigger conditions</h2>
        <div>
            <p>The prompt will display when you choose Item 1 or Item 3, but not Item 2.</p>
        </div>
        <div>
            <asp:DropDownList ID="dropDown1" runat="server">
                <asp:ListItem Value="0" Text="--Select--" />
                <asp:ListItem Value="1" Text="Item 1" />
                <asp:ListItem Value="2" Text="Item 2" />
                <asp:ListItem Value="3" Text="Item 3" />
            </asp:DropDownList>
            
<ae:Prompt ID="prompt1" Title="Prompt Sample 3" Message="I am prompt sample 3." ButtonOptions="Ok" runat="server">
    <Triggers>
        <ae:ControlPromptTrigger ControlID="dropDown1" EventName="change" ScriptCondition="meetsCondition" />
    </Triggers>
</ae:Prompt>
            
            
        </div>
    </div>
    </form>
</body>
</html>
